#!/usr/bin/env python
# -*- coding: utf-8 -*-
#coding=utf8

# 本文件由自动工具 proto.py 自动生成，请勿修改
# filename msg1100_csbuf.py
# package ptl

from ptl.base_csbuf import *


# message Req1101
class Req1101:
	def __init__(self):
		self.protoid = 1101
		self.platformId = ""
		self.token = ""
		self.time = 0
		self.ver = 0
		self.sdkId = 0
		self.deviceTp = 0
		self.devInfo = ""
		self.packing = 0
		self.serverId = ""
		self.packagename = ""
		self.zone = 0
		self.sign = ""

	def Marshal(writer):
		writer.setString(self.platformId, 1)
		writer.setString(self.token, 2)
		writer.setUint64(self.time, 3)
		writer.setUint32(self.ver, 4)
		writer.setUint32(self.sdkId, 5)
		writer.setUint32(self.deviceTp, 6)
		writer.setString(self.devInfo, 7)
		writer.setUint32(self.packing, 8)
		writer.setString(self.serverId, 9)
		writer.setString(self.packagename, 10)
		writer.setUint32(self.zone, 11)
		writer.setString(self.sign, 12)

	def Unmarshal( reader):
		self.platformId = reader.getString(1)
		self.token = reader.getString(2)
		self.time = reader.getUint64(3)
		self.ver = reader.getUint32(4)
		self.sdkId = reader.getUint32(5)
		self.deviceTp = reader.getUint32(6)
		self.devInfo = reader.getString(7)
		self.packing = reader.getUint32(8)
		self.serverId = reader.getString(9)
		self.packagename = reader.getString(10)
		self.zone = reader.getUint32(11)
		self.sign = reader.getString(12)
# message Resp1101
class Resp1101:
	def __init__(self):
		self.protoid = 1101
		self.state = 0
		self.unUseMods = 0
		self.lastLoginTime = 0
		self.svrTime = 0
		self.svrTimezone = 0
		self.playerId = 0
		self.token = ""
		self.serverId = ""
		self.guideIndex = 0

	def Marshal(writer):
		writer.setUint32(self.state, 1)
		writer.setUint32(self.unUseMods, 2)
		writer.setUint32(self.lastLoginTime, 3)
		writer.setUint64(self.svrTime, 4)
		writer.setUint64(self.svrTimezone, 5)
		writer.setUint32(self.playerId, 6)
		writer.setString(self.token, 7)
		writer.setString(self.serverId, 8)
		writer.setUint8(self.guideIndex, 9)

	def Unmarshal( reader):
		self.state = reader.getUint32(1)
		self.unUseMods = reader.getUint32(2)
		self.lastLoginTime = reader.getUint32(3)
		self.svrTime = reader.getUint64(4)
		self.svrTimezone = reader.getUint64(5)
		self.playerId = reader.getUint32(6)
		self.token = reader.getString(7)
		self.serverId = reader.getString(8)
		self.guideIndex = reader.getUint8(9)
# message Resp1102
class Resp1102:
	def __init__(self):
		self.protoid = 1102
		self.info = UserInfo()

	def Marshal(writer):
		writer.setMessage(1)
		self.info.Marshal(writer)
		writer.endSetMessage()

	def Unmarshal( reader):
		reader.getMessage(1)
		self.info.Unmarshal(reader)
		reader.endGetMessage()
# message Resp1103
class Resp1103:
	def __init__(self):
		self.protoid = 1103
		self.ktype = 0

	def Marshal(writer):
		writer.setUint8(self.ktype, 1)

	def Unmarshal( reader):
		self.ktype = reader.getUint8(1)
# message Resp1104
class Resp1104:
	def __init__(self):
		self.protoid = 1104
		self.cmdId = 0
		self.cmdInfo = ""
		self.nParam = 0
		self.strParam = ""

	def Marshal(writer):
		writer.setUint32(self.cmdId, 1)
		writer.setString(self.cmdInfo, 2)
		writer.setInt32(self.nParam, 3)
		writer.setString(self.strParam, 4)

	def Unmarshal( reader):
		self.cmdId = reader.getUint32(1)
		self.cmdInfo = reader.getString(2)
		self.nParam = reader.getInt32(3)
		self.strParam = reader.getString(4)
# message Req1105
class Req1105:
	def __init__(self):
		self.protoid = 1105
		self.playerIds = []

	def Marshal(writer):
		countplayerIds = len(self.playerIds)
		writer.setArray(countplayerIds, 1)
		for i in range(countplayerIds):
			writer.setUint32(self.playerIds[i], 0)

	def Unmarshal( reader):
		for i in range(reader.getArray(1)):
			self.playerIds.append(reader.getUint32(0))
# message Resp1105
class Resp1105:
	def __init__(self):
		self.protoid = 1105
		self.list = []
		self.bags = []
		self.heros = []
		self.bid = ""

	def Marshal(writer):
		countlist = len(self.list)
		writer.setArray(countlist, 1)
		for i in range(countlist):
			writer.setMessage(0)
			self.list[i].Marshal(writer)
			writer.endSetMessage()
		countbags = len(self.bags)
		writer.setArray(countbags, 2)
		for i in range(countbags):
			writer.setMessage(0)
			self.bags[i].Marshal(writer)
			writer.endSetMessage()
		countheros = len(self.heros)
		writer.setArray(countheros, 3)
		for i in range(countheros):
			writer.setMessage(0)
			self.heros[i].Marshal(writer)
			writer.endSetMessage()
		writer.setString(self.bid, 4)

	def Unmarshal( reader):
		for i in range(reader.getArray(1)):
			msg = UserInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.list.append(msg)
		for i in range(reader.getArray(2)):
			msg = GoodsInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.bags.append(msg)
		for i in range(reader.getArray(3)):
			msg = HeroInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.heros.append(msg)
		self.bid = reader.getString(4)
# message Req1106
class Req1106:
	def __init__(self):
		self.protoid = 1106
		self.name = ""
		self.param = ""
		self.packagename = ""
		self.appsflyerid = ""

	def Marshal(writer):
		writer.setString(self.name, 1)
		writer.setString(self.param, 2)
		writer.setString(self.packagename, 3)
		writer.setString(self.appsflyerid, 4)

	def Unmarshal( reader):
		self.name = reader.getString(1)
		self.param = reader.getString(2)
		self.packagename = reader.getString(3)
		self.appsflyerid = reader.getString(4)
# message Resp1106
class Resp1106:
	def __init__(self):
		self.protoid = 1106
		self.playerId = 0

	def Marshal(writer):
		writer.setUint32(self.playerId, 1)

	def Unmarshal( reader):
		self.playerId = reader.getUint32(1)
# message Req1107
class Req1107:
	def __init__(self):
		self.protoid = 1107
		self.guideIndex = 0

	def Marshal(writer):
		writer.setUint32(self.guideIndex, 1)

	def Unmarshal( reader):
		self.guideIndex = reader.getUint32(1)
# message Resp1107
class Resp1107:
	def __init__(self):
		self.protoid = 1107
		self.status = 0

	def Marshal(writer):
		writer.setUint8(self.status, 1)

	def Unmarshal( reader):
		self.status = reader.getUint8(1)
# message Req1108
class Req1108:
	def __init__(self):
		self.protoid = 1108
		self.playerId = 0
		self.name = ""
		self.guideIndex = 0

	def Marshal(writer):
		writer.setUint32(self.playerId, 1)
		writer.setString(self.name, 2)
		writer.setUint32(self.guideIndex, 3)

	def Unmarshal( reader):
		self.playerId = reader.getUint32(1)
		self.name = reader.getString(2)
		self.guideIndex = reader.getUint32(3)
# message Resp1108
class Resp1108:
	def __init__(self):
		self.protoid = 1108
		self.status = 0

	def Marshal(writer):
		writer.setUint32(self.status, 1)

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
# message Req1109
class Req1109:
	def __init__(self):
		self.protoid = 1109
		self.playerId = 0

	def Marshal(writer):
		writer.setUint32(self.playerId, 1)

	def Unmarshal( reader):
		self.playerId = reader.getUint32(1)
# message Resp1109
class Resp1109:
	def __init__(self):
		self.protoid = 1109
		self.status = 0
		self.info = PubliPlayerInfo()
		self.teams = []
		self.heros = []
		self.equips = []

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		writer.setMessage(2)
		self.info.Marshal(writer)
		writer.endSetMessage()
		countteams = len(self.teams)
		writer.setArray(countteams, 3)
		for i in range(countteams):
			writer.setMessage(0)
			self.teams[i].Marshal(writer)
			writer.endSetMessage()
		countheros = len(self.heros)
		writer.setArray(countheros, 4)
		for i in range(countheros):
			writer.setMessage(0)
			self.heros[i].Marshal(writer)
			writer.endSetMessage()
		countequips = len(self.equips)
		writer.setArray(countequips, 5)
		for i in range(countequips):
			writer.setMessage(0)
			self.equips[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		reader.getMessage(2)
		self.info.Unmarshal(reader)
		reader.endGetMessage()
		for i in range(reader.getArray(3)):
			msg = TeamItem() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.teams.append(msg)
		for i in range(reader.getArray(4)):
			msg = HeroInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.heros.append(msg)
		for i in range(reader.getArray(5)):
			msg = EquipInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.equips.append(msg)
